Core Java Interview Questions and Answers
Test your skills through the online practice test: Core Java Quiz Online Practice Test
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
Ques 221. Can a Byte object be cast to a double value?
No, an object cannot be cast to a primitive value.
Is it helpful?
Add Comment
View Comments
Ques 222. How is rounding performed under integer division?
The fractional part of the result is truncated. This is known as rounding toward zero.
Is it helpful?
Add Comment
View Comments
Ques 223. What would you use to compare two String variables - the operator == or the method equals()?
I would use the method equals() to compare the values of the Strings and the == to check if two variables point at the same instance of a String object.
Is it helpful?
Add Comment
View Comments
Ques 224. Which non-Unicode letter characters may be used as the first character of an identifier?
The non-Unicode letter characters $ and _ may appear as the first character of an identifier
Is it helpful?
Add Comment
View Comments
Ques 225. What is a hashCode?
hash code value for this object which is unique for every object.
Is it helpful?
Add Comment
View Comments
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
Most helpful rated by users:
- How could Java classes direct program messages to the system console, but error messages, say to a file?
- What are the differences between an interface and an abstract class?
- Why would you use a synchronized block vs. synchronized method?
- How can you force garbage collection?
- What are the differences between the methods sleep() and wait()?